#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton* _button=new QPushButton(this);
    _button->setText("按钮");
    _button->move(100,100);
    connect(_button,&QPushButton::clicked,this,&Widget::handClicked);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::handClicked()
{
    //按下按钮，修改窗口标题
    this->setWindowTitle("按钮已经按下");
}
